package nongchang.kuaijiecaifu.com.ncapp_android.util;

import android.content.Context;
import android.os.Handler;

import kprogresshud.KProgressHUD;
import nongchang.kuaijiecaifu.com.ncapp_android.Kuaijie;

/**
 * Created by Administrator on 2016/6/15 0015.
 */
public class DialogUtil {
    public static  KProgressHUD hud;
    public static void show(Context context){
            hud = KProgressHUD.create(context)
                    .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
                    .setCancellable(true).show();
        scheduleDismiss();
    }
    public static void scheduleDismiss() {
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                hud.dismiss();
            }
        }, 700);
    }
    public static void close(){
        if(hud!=null){
            hud.dismiss();
        }
    }
}
